package com.sanyang.lawyer.controller.adm;

import com.sanyang.lawyer.entity.Sign;
import com.sanyang.lawyer.service.adm.SignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: lawyer
 * @description: 签到的controller
 * @author: Mr.Wang
 * @create: 2019-11-01 15:40
 **/

@RestController
@RequestMapping("sign")
public class AdmSignController {

    @Autowired
    private SignService signService;

    @RequestMapping("listall")
    public List<Sign> listall(int userId){
        List<Sign> list=signService.listAll(userId);
        return list;
    }



    @RequestMapping("listfurry")
    public List<Sign> listfurry(String sname,String kdate,String jdate,String userId){
        Map<String,String> map=new HashMap<String,String>();
        map.put("userId",userId);
        if(sname!=""&&sname!=null){
            map.put("sname",sname);
        }
        if(kdate!=""&&kdate!=null){
            map.put("kdate",kdate);
        }
        if(jdate!=""&&jdate!=null){
            map.put("jdate",jdate);
        }
        List<Sign> list=signService.listfurry(map);
        return list;
    }
}
